package com.app.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.app.R;
import com.app.model.bean.User;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/1/16.
 */

public class ActivteAdapter extends RecyclerView.Adapter {

    private Context mContext;

    private List<User> items = new ArrayList<>();


    public ActivteAdapter(Context context) {
        mContext = context;
    }

    public void setItems(List<User> users) {
        this.items = users;
        notifyDataSetChanged();
    }

    public void addItems(List<User> users) {
        items.addAll(users);
        notifyDataSetChanged();
    }


    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_active, parent, false);
        MViewHolder viewHolder = new MViewHolder(itemView);

        return viewHolder;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
    }

    @Override
    public int getItemCount() {
        return items.size();
    }

    class MViewHolder extends RecyclerView.ViewHolder {

        public MViewHolder(View itemView) {
            super(itemView);
        }
    }
}
